﻿using IdentityServer.Domain.Entities;
using IdentityServer.Infrastructure.Services;
using Infrastructure.EFCore;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace IdentityServer.Infrastructure
{
    public class IdDbContext : IdentityDbContext<AppUser, AppRole, Guid>
    {
        public IdDbContext(DbContextOptions options) : base(options)
        {
            
        }
        public DbSet<EmailCode> EmailCodes { get; set; }
        public DbSet<WeChatUser> WeChatUsers { get; set; }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
            builder.ApplyConfigurationsFromAssembly(this.GetType().Assembly);
            builder.EnableSoftDeletionGlobalFilter();
        }
    }
}
